
#ifndef TOOLS_UTIL
#define TOOLS_UTIL

#include <cstdint>
#include <unistd.h>
#include <string>
#include <netdb.h>
#include <arpa/inet.h>
#include <vector>


struct ServerAddressInfo
{
    std::string ip;
    uint16_t    port;
};

struct UrlInfo
{
    std::string domain; 
    std::string protocol;
    uint16_t    port{0};
    std::string user_name;
    std::string user_password;
    std::string resource_path;
    std::vector<ServerAddressInfo> server_vec;
};

bool GetServerAddrInfo(const std::string & url,UrlInfo & url_info);
UrlInfo ParseUrlData(const std::string &url);
void GetAddrInfo(UrlInfo & url_info);

#endif
